﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfMvvmDemo.Views
{
    /// <summary>
    /// StyleView.xaml 的交互逻辑
    /// </summary>
    public partial class StyleView : UserControl
    {
        public StyleView()
        {
            InitializeComponent();

            ICSharpCode.AvalonEdit.Search.SearchPanel.Install(textBox_CSharp);
            ICSharpCode.AvalonEdit.Search.SearchPanel.Install(textBox_Xaml);
            ICSharpCode.AvalonEdit.Search.SearchPanel.Install(textBox_ViewModel);
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            string csharpXamlPath = $@"/WpfMvvmDemoCode;component/Views/StyleView.xaml";
            textBox_Xaml.Text = CodeHelper.GetCode(csharpXamlPath);

            string csharpCodePath = $@"/WpfMvvmDemoCode;component/Views/StyleView.xaml.cs";
            textBox_CSharp.Text = CodeHelper.GetCode(csharpCodePath);

            string vmCodePath = $@"/WpfMvvmDemoCode;component/ViewModels/StyleViewModel.cs";
            textBox_ViewModel.Text = CodeHelper.GetCode(vmCodePath);
        }
    }
}
